{extend name="../../admin/view/main"}

{block name="button"}
<!--{if auth('config')}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('config')}">发货地址管理</a>
<!--{/if}-->
{/block}

{block name="content"}
<div class="layui-tab layui-tab-card table-block">
    <ul class="layui-tab-title notselect">
        {foreach ['ta'=>'全部订单','t1'=>'待发货的订单','t2'=>'已发货的订单','t0'=>'已取消的订单'] as $k => $v}
        {if isset($type) and 't'.$type eq $k}
        <li data-open="{:url('index')}?type={$k}" class="layui-this">{$v}<sup class="layui-badge border-radius">{$total[$k]??0}</sup></li>
        {else}
        <li data-open="{:url('index')}?type={$k}">{$v}<sup class="layui-badge border-radius">{$total[$k]??0}</sup></li>
        {/if}{/foreach}
    </ul>
    <div class="layui-tab-content table-block">
        {include file='shop_order_send/index_search'}
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='list-table-check-td think-checkbox'>
                    <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
                </th>
                <th>用户信息</th>
                <th>收货信息</th>
                <th>发货状态</th>
                <th></th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr>
                <td class='list-table-check-td think-checkbox'>
                    <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
                </td>
                <td class="nowrap relative">
                    <div class="headimg" style="width:56px;height:56px" data-tips-image data-lazy-src="{$vo.user.headimg|default='__ROOT__/static/theme/img/headimg.png'}"></div>
                    <div class="inline-block sub-span-blue">
                        用户昵称：<span>{$vo.user.nickname|default='-'}</span><br>
                        用户手机：<span>{$vo.user.phone|default='-'}</span><br>
                        订单单号：<span>{$vo.order_no|default='-'}</span><br>
                    </div>
                </td>
                <td class="nowrap">
                    <div>身份证号：{$vo.address_idcode|default='-'}</div>
                    <div>收货姓名：{$vo.address_name|default='-'}<span class="margin-left-5 color-blue">{$vo.address_phone}</span></div>
                    <div>收货地址：{$vo.address_province|default='-'}{$vo.address_city}{$vo.address_area}{$vo.address_content}</div>
                    <div>提交时间：{$vo.address_datetime|format_datetime}</div>
                </td>
                <td class="nowrap">
                    {if empty($vo.send_datetime)}
                    <span class="layui-badge layui-bg-black">未发货</span>
                    {else}
                    <span class="layui-badge layui-bg-blue">{$vo.company_name|default='-'}</span>
                    <a data-title="{$vo.company_name}（{$vo.send_number}）" data-tips-text="快递追踪查询"
                       data-modal="{:url('shop_order/truckQuery')}?code={$vo.company_code}&number={$vo.send_number}"
                       class="layui-badge layui-bg-orange margin-left-5">{$vo.send_number|default='-'}</a>
                    <div class="margin-top-5">于 <b>{$vo.send_datetime|format_datetime} 发货！</b></div>
                    {/if}
                </td>
                <td class="color-desc">
                    <!--{if auth('shop_order/truck') and $vo.status eq 1}-->
                    <a class="layui-btn layui-btn-sm" data-title="填写订单信息" data-modal="{:url('shop_order/truck')}?order_no={$vo.order_no}">填写发货</a>
                    <!--{elseif auth('shop_order/truck') and $vo.status eq 2}-->
                    <a class="layui-btn layui-btn-sm" data-title="修改发货信息" data-modal="{:url('shop_order/truck')}?order_no={$vo.order_no}">修改发货</a>
                    <!--{/if}-->
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>

        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

    </div>
</div>
{/block}
